<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>nrf51/Include/console.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css" />
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="alias.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="alias.js"></script>

<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>


<script type="text/javascript">
  jQuery(document).ready(function () {
    if(gref){ // Number all _img and _table classes
      gref();
    }
  });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->

<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">nRF51 General Code Examples
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('console_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">nrf51/Include/console.h</div>  </div>
</div>
<div class="contents">
<a href="console_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (c) 2007 Nordic Semiconductor. All Rights Reserved.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * The information contained herein is confidential property of Nordic Semiconductor. The use,</span>
<a name="l00005"></a>00005 <span class="comment"> * copying, transfer or disclosure of such information is prohibited except by express written</span>
<a name="l00006"></a>00006 <span class="comment"> * agreement with Nordic Semiconductor.</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> */</span>
<a name="l00009"></a>00009 
<a name="l00010"></a>00010 
<a name="l00077"></a>00077 <span class="preprocessor">#ifndef CONSOLE_H__</span>
<a name="l00078"></a>00078 <span class="preprocessor"></span><span class="preprocessor">#define CONSOLE_H__</span>
<a name="l00079"></a>00079 <span class="preprocessor"></span>
<a name="l00080"></a>00080 <span class="preprocessor">#include &lt;stdint.h&gt;</span>
<a name="l00081"></a>00081 <span class="preprocessor">#include &lt;stdbool.h&gt;</span>
<a name="l00082"></a>00082 
<a name="l00083"></a>00083 <span class="comment">/* Newline character sequences */</span>
<a name="l00084"></a><a class="code" href="console_8h.html#ae9323435a46e3f28bb7de7a6bf13bf5c">00084</a> <span class="preprocessor">#define CONSOLE_NEWLINE_CRLF          &quot;\r\n&quot; //!&lt; CRLF newline </span>
<a name="l00085"></a><a class="code" href="console_8h.html#aba3dac0b2be6e93650b55d95f241449f">00085</a> <span class="preprocessor"></span><span class="preprocessor">#define CONSOLE_NEWLINE_CR            &quot;\r&quot; //!&lt; CR newline</span>
<a name="l00086"></a><a class="code" href="console_8h.html#aa946bb6df15c0d3161a8d3578d2e4e73">00086</a> <span class="preprocessor"></span><span class="preprocessor">#define CONSOLE_NEWLINE_LF            &quot;\n&quot; //!&lt; LF newline </span>
<a name="l00087"></a><a class="code" href="console_8h.html#a378808c50717aedc3b8fb34ac1d7f383">00087</a> <span class="preprocessor"></span><span class="preprocessor">#define CONSOLE_NEWLINE_CRLF_NUMERIC  &quot;\x0D\x0A&quot;  //!&lt; Hardcoded ASCII values for CRLF</span>
<a name="l00088"></a><a class="code" href="console_8h.html#a5ccd6a3b1875d6f858a2dbd644f8371c">00088</a> <span class="preprocessor"></span><span class="preprocessor">#define CONSOLE_NEWLINE_CR_NUMERIC    &quot;\x0D&quot;      //!&lt; It is possible, though unlikely, that</span>
<a name="l00089"></a><a class="code" href="console_8h.html#aeb3a956c206c9e084c0a4da2a018fc2c">00089</a> <span class="preprocessor"></span><span class="preprocessor">#define CONSOLE_NEWLINE_LF_NUMERIC    &quot;\x0A&quot;      //!&lt; CR and LF do not equal these values.</span>
<a name="l00090"></a>00090 <span class="preprocessor"></span>
<a name="l00091"></a><a class="code" href="console_8h.html#a170d2e914dd4a59888999fcf99ef7e3e">00091</a> <span class="preprocessor">#define CONSOLE_NEWLINE_DEFAULT       CONSOLE_NEWLINE_CRLF_NUMERIC   </span>
<a name="l00093"></a>00093 <span class="preprocessor"></span><span class="comment">/* Newline style for input */</span>
<a name="l00094"></a>00094 <span class="preprocessor">#ifndef CONSOLE_NEWLINE_INPUT</span>
<a name="l00095"></a>00095 <span class="preprocessor"></span>  <span class="comment">/* CONSOLE_NEWLINE_INPUT was not defined in console_config.h */</span>
<a name="l00096"></a><a class="code" href="console_8h.html#a7353e57bb28dd103bf4deb4a2b5933ab">00096</a> <span class="preprocessor">  #define CONSOLE_NEWLINE_INPUT      CONSOLE_NEWLINE_DEFAULT //!&lt; Newline style for input </span>
<a name="l00097"></a>00097 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00098"></a>00098 <span class="preprocessor"></span>  
<a name="l00099"></a>00099 <span class="comment">/* Newline style for output */</span>
<a name="l00100"></a>00100 <span class="preprocessor">#ifndef CONSOLE_NEWLINE_OUTPUT</span>
<a name="l00101"></a>00101 <span class="preprocessor"></span>  <span class="comment">/* CONSOLE_NEWLINE_OUTPUT was not defined in console_config.h */</span>
<a name="l00102"></a><a class="code" href="console_8h.html#af07ee703ec64d3ce593b8844497ec6b5">00102</a> <span class="preprocessor">  #define CONSOLE_NEWLINE_OUTPUT     CONSOLE_NEWLINE_DEFAULT //!&lt; Newline style for output </span>
<a name="l00103"></a>00103 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00104"></a>00104 <span class="preprocessor"></span>
<a name="l00112"></a>00112 <span class="keywordtype">void</span> <a class="code" href="console_8c.html#acadd2a5d99d952e55a4580dbc8f8739d" title="Initialise the console Init must be called prior to any other console functions. The success of init(...">console_init</a>(<span class="keywordtype">void</span>);
<a name="l00113"></a>00113 
<a name="l00119"></a>00119 <span class="keywordtype">bool</span> <a class="code" href="console_8c.html#a40c172c3e7e308f7dfae3a0463b6426a" title="test if the console is available">console_available</a>(<span class="keywordtype">void</span>);
<a name="l00120"></a>00120 
<a name="l00121"></a>00121 
<a name="l00129"></a>00129 <span class="keywordtype">void</span> <a class="code" href="console_8c.html#a288d6a3d61505a952a7454b6de7933c0" title="Print a string.">console_put_string</a>(uint8_t <span class="keyword">const</span>  * <span class="keywordtype">string</span>);
<a name="l00130"></a>00130 
<a name="l00131"></a>00131 
<a name="l00140"></a>00140 <span class="keywordtype">void</span> <a class="code" href="console_8c.html#a8021e43ed0d7a1ff861d4816da7f6953" title="Print a string and newline.">console_put_line</a>(uint8_t <span class="keyword">const</span>  * <span class="keywordtype">string</span>);
<a name="l00141"></a>00141 
<a name="l00142"></a>00142 
<a name="l00146"></a>00146 <span class="keywordtype">void</span> <a class="code" href="console_8c.html#abe212ad1076b2e3867f1bbdf337f0c8b" title="Print a newline (the newline output sequence)">console_put_newline</a>(<span class="keywordtype">void</span>);
<a name="l00147"></a>00147 
<a name="l00148"></a>00148 
<a name="l00155"></a>00155 <span class="keywordtype">void</span> <a class="code" href="console_8c.html#a91ba50924b7d9b834bf9afb6f028b5a6" title="Print a number of characters (octets)">console_put_chars</a>(uint8_t <span class="keyword">const</span>  * chars, uint8_t num_chars);
<a name="l00156"></a>00156 
<a name="l00157"></a>00157 
<a name="l00166"></a>00166 <span class="keywordtype">void</span> <a class="code" href="console_8c.html#a7fdeda12b74c3c6d31e1a3868da2c83e" title="Read a number of characters (octets) and append zero-termination.">console_get_string</a>(uint8_t * <span class="keywordtype">string</span>, uint8_t num_chars);
<a name="l00167"></a>00167 
<a name="l00194"></a>00194 <span class="keywordtype">void</span> <a class="code" href="console_8c.html#aa625988d32d91c2f10e296cfc2ba7fc4" title="Read a line.">console_get_line</a>(uint8_t * <span class="keywordtype">string</span>, uint8_t max_len);
<a name="l00195"></a>00195 
<a name="l00201"></a>00201 <span class="keywordtype">bool</span> <a class="code" href="console_8c.html#a87d205e18afe8214415dd1a91298a047" title="Get number of characters sent to console.">console_chars_available</a>(<span class="keywordtype">void</span>);
<a name="l00202"></a>00202 
<a name="l00209"></a>00209 <span class="keywordtype">void</span> <a class="code" href="console_8c.html#ac69f8486961878f4bf2772df04efb83e" title="Read a number of characters (octets)">console_get_chars</a>(uint8_t * chars, uint8_t num_chars);
<a name="l00210"></a>00210 
<a name="l00211"></a>00211 
<a name="l00220"></a>00220 <span class="keywordtype">void</span> <a class="code" href="console_8c.html#a5a3a4e7afed36a710d28bbfcd87bd5f4">console_put_char</a>(uint8_t ch);
<a name="l00221"></a>00221 
<a name="l00222"></a>00222 
<a name="l00231"></a>00231 uint8_t <a class="code" href="console_8c.html#a81c0d0329a3b22147fccfaf8ec2ef312">console_get_char</a>(<span class="keywordtype">void</span>);
<a name="l00232"></a>00232 
<a name="l00233"></a>00233 
<a name="l00242"></a>00242 <span class="keywordtype">void</span> <a class="code" href="console_8c.html#a04ad2ca4a04cc4c0af10f60697aa5c27" title="Print the decimal ASCII representation of an 8-bit number.">console_put_decbyte</a>(uint8_t b);
<a name="l00243"></a>00243 
<a name="l00244"></a>00244 
<a name="l00253"></a>00253 <span class="keywordtype">void</span> <a class="code" href="console_8c.html#a860f9446b8b623ed568e9cb2fc3812d2" title="Print the decimal ASCII representation of a 16-bit number.">console_put_decword</a>(uint16_t w);
<a name="l00254"></a>00254 
<a name="l00255"></a>00255 
<a name="l00264"></a>00264 <span class="keywordtype">void</span> <a class="code" href="console_8c.html#a285b3981903d4d7cc3cf3fd829c8c5f2" title="Print the decimal ASCII representation of a 32-bit number.">console_put_dec32bit</a>(uint32_t ww);
<a name="l00265"></a>00265 
<a name="l00266"></a>00266 
<a name="l00274"></a>00274 <span class="keywordtype">void</span> <a class="code" href="console_8c.html#a614aac471317ed14a5093a9ec6297bf7" title="Print the hexadecimal ASCII representation of a nybble (half an octet, four bits)">console_put_hexnybble</a>(uint8_t n);
<a name="l00275"></a>00275 
<a name="l00276"></a>00276 
<a name="l00281"></a>00281 <span class="keywordtype">void</span> <a class="code" href="console_8c.html#ad2c04c623a2d742eb152fe38a07d11ef" title="Print the hexadecimal ASCII representation of a byte (an octet)">console_put_hexbyte</a>(uint8_t b);
<a name="l00282"></a>00282 
<a name="l00283"></a>00283 
<a name="l00288"></a>00288 <span class="keywordtype">void</span> <a class="code" href="console_8c.html#afcba7444c77bb609aff7ed32b21dff2a" title="Print the hexadecimal ASCII representation of a word (two octets)">console_put_hexword</a>(uint16_t w);
<a name="l00289"></a>00289 
<a name="l00295"></a>00295 <span class="keywordtype">void</span> <a class="code" href="console_8c.html#a95646f056e633c0ba3f6b68a0edd5d70" title="Print a string of hexbytes.">console_put_hexbytearray</a>(uint8_t* p, uint8_t n);
<a name="l00296"></a>00296 
<a name="l00307"></a>00307 uint8_t <a class="code" href="console_8c.html#aed1839189ad48d50f53e291bd4724281" title="Read one hexadecimal digit.">console_get_hexnybble</a>(<span class="keywordtype">void</span>);
<a name="l00308"></a>00308 
<a name="l00309"></a>00309 
<a name="l00319"></a>00319 uint8_t <a class="code" href="console_8c.html#aad18fd449769df9326d38f3ed70c97f2" title="Read two hexadecimal digits.">console_get_hexbyte</a>(<span class="keywordtype">void</span>);
<a name="l00320"></a>00320 
<a name="l00321"></a>00321 
<a name="l00331"></a>00331 uint16_t <a class="code" href="console_8c.html#ae1169ccddd374a94f9ff795d12c93cb8" title="Read four hexadecimal digits.">console_get_hexword</a>(<span class="keywordtype">void</span>);
<a name="l00332"></a>00332 
<a name="l00337"></a>00337 <span class="keywordtype">bool</span> <a class="code" href="console_8h.html#a9467d92ca38e9feec9beec727cf4623a" title="Checks the last tx is completed.">console_tx_completed</a>(<span class="keywordtype">void</span>);
<a name="l00338"></a>00338 
<a name="l00339"></a>00339 <span class="preprocessor">#endif</span>
<a name="l00340"></a>00340 <span class="preprocessor"></span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="console_8h.html">console.h</a>      </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">
      Copyright &copy 2006-2011 <a href="http://www.nordicsemi.no" style="text-decoration:none">Nordic Semiconductor</a>.
      All Rights Reserved.
      <a href="disclaimer.html">Disclaimer</a>
    </li>
   </ul>
 </div>


</body>
</html>
